# Maintainer: Celeste <cielesti@protonmail.com>
maintainer="Celeste <cielesti@protonmail.com>"
pkgname=emacs-buttercup
pkgver=1.35
pkgrel=0
_pkgreal=buttercup
pkgdesc="Behavior-Driven Emacs Lisp Testing"
url="https://github.com/jorgenschaefer/emacs-buttercup"
arch="noarch"
license="GPL-3.0-or-later"
depends="bash cmd:emacs"
makedepends="emacs-nox"
source="https://github.com/jorgenschaefer/emacs-buttercup/archive/v$pkgver/emacs-buttercup-$pkgver.tar.gz"

build() {
	emacs -batch -q -no-site-file -L . \
		-eval '(setq byte-compile-error-on-warn t)' \
		-f batch-byte-compile \
		./*.el
}

check() {
	emacs -batch -q -no-site-file -L . \
		-l buttercup -f buttercup-run-discover \
		-- --traceback pretty
}

package() {
	install -Dvm755 bin/buttercup \
		-t "$pkgdir"/usr/bin/

	install -Dvm644 ./*.el ./*.elc \
		-t "$pkgdir"/usr/share/emacs/site-lisp/

	cd "$pkgdir"/usr/share/emacs/site-lisp
	emacs -batch -q -no-site-file \
		-eval "(loaddefs-generate \".\" \"$_pkgreal-loaddefs.el\")"
}

sha512sums="
416edb974999e2eac38040ce72c241ab961cc63f40068711b0436e4f3ca49025955d5ee2d93168770da0f251269652e36c1c9c0436f6ee6133c6ca859dbfe487  emacs-buttercup-1.35.tar.gz
"
